{% extends "base.html" %}
{% load paginator %}
{% load timezone %}
{% block title %}{% if CURRENT_LANGUAGE %}{{ CURRENT_LANGUAGE.name }} - {% endif %}{% if CURRENT_TAG %}{{ CURRENT_TAG.name }} - {% endif %}Snipperize{% endblock %}
{% block meta %}
<meta name="keywords" content="{% if CURRENT_LANGUAGE %}{{ CURRENT_LANGUAGE.name }}, {{ CURRENT_LANGUAGE.name }} snippets {% else %} {% for l, v in request.SUPPORT_LANGUAGES.items %}{{ v }} snippets{% if not forloop.last %}, {% endif %}{% endfor %}, {% for l, v in request.SUPPORT_LANGUAGES.items %}{{ v }}{% if not forloop.last %}, {% endif %}{% endfor %}{% endif %}" />
<meta name="description" content="Here are the latest {% if CURRENT_LANGUAGE %}{{ CURRENT_LANGUAGE.name }} {% endif %}snippets. Snipperize is a code clips warehouse, support {% for l, v in request.SUPPORT_LANGUAGES.items %}{{ v }}{% if not forloop.last %}, {% endif %}{% endfor %}" />
{% endblock %}
{% block title_subs %}
{% if CURRENT_LANGUAGE and CURRENT_TAG %}
<span class="divider">/</span>{{ CURRENT_LANGUAGE.name }}<span class="divider">/</span>{{ CURRENT_TAG.name }}
{% else %}{% if CURRENT_LANGUAGE %}
<span class="divider">/</span>{{ CURRENT_LANGUAGE.name }}
{% else %}{% if CURRENT_TAG %}
<span class="divider">/</span>{{ CURRENT_TAG.name }}
{% endif %}{% endif %}{% endif %}
{% endblock %}
{% block promo %}
<div class="promo green">Snipperize is a code clips warehouse, support nearly all the computer languages.</div>
<div class="promo orange">Here are the latest {% if CURRENT_LANGUAGE %}<a href="{% url language_snippets CURRENT_LANGUAGE.key %}" title="{{ CURRENT_LANGUAGE.name }} snippets">{{ CURRENT_LANGUAGE.name }}</a> {% endif %}snippets{% if CURRENT_TAG %} talking about <a href="{% if CURRENT_LANGUAGE %}{% url language_tag_snippets CURRENT_LANGUAGE.key CURRENT_TAG.get_escape_name CURRENT_TAG.key.id %}{% else %}{% url tag_snippets CURRENT_TAG.get_escape_name CURRENT_TAG.key.id %}{% endif %}" title="{% if CURRENT_LANGUAGE %}{{ CURRENT_LANGUAGE.name }} {% endif %}{{ CURRENT_TAG.name }} snippets">{{ CURRENT_TAG.name }}</a>{% endif %}. Please choose your favorite one or <a href="{% url snippet_add %}" title="new snippet" rel="nofollow">add a new one</a>.</div>
{% endblock %}
{% block body_content %}
{% if object_list %}
{% if RELEVENT_TAGS %}
<div class="side-box">
<div class="relevent_tags">
    <h2>Relevent Tags</h2>
    <ul>
        {% for tag in RELEVENT_TAGS %}
        <li><a href="{% if CURRENT_LANGUAGE %}{% url language_tag_snippets CURRENT_LANGUAGE.key tag.get_escape_name tag.key.id %}{% else %}{% url tag_snippets tag.get_escape_name tag.key.id %}{% endif %}" title="{{ tag.name }} snippets">{{ tag.name }}</a></li>
        {% endfor %}
    </ul>
    <a href="{% if CURRENT_LANGUAGE %}{% url language_tags CURRENT_LANGUAGE.key %}{% else %}{% url tag_list %}{% endif %}" title="more tags">more tags...</a>
</div>
</div>
{% endif %}
{% for snippet in object_list %}
    <h2>{% ifequal snippet.author.email request.current_user.email %}<span class="editsection">[<a href="{{ snippet.get_edit_url }}" title="edit this snippet">edit</a>]</span><span class="deletesection">[<a href="{{ snippet.get_delete_url }}" title="delete this snippet">delete</a>]</span>{% endifequal %}<span class="mw-headline"><a href="{{ snippet.get_absolute_url }}" title="{{ snippet.title }}">{{ snippet.title }}</a></span></h2>
    <p><span style="background:yellow"><a href="{% url language_snippets snippet.language %}" title="{{ snippet.get_language.name }} snippets">{{ snippet.get_language.name }}</a></span>{% for tag in snippet.get_tags %}{% if forloop.first %} / {% endif %}<code><a href="{% url language_tag_snippets snippet.language tag.get_escape_name tag.key.id %}" title="{{ snippet.get_language.name }} {{ tag.name }} snippets">{{ tag.name }}</a></code>{% if forloop.last %} / {% else %}, {% endif %}{% endfor %}by <a href="{{ snippet.author.get_absolute_url }}" title="{{ snippet.author.user.nickname }}'s snippets">{{ snippet.author.user.nickname }}</a> ({% ifnotequal snippet.elapsed.days 0 %}{{ snippet.elapsed.days }} days, {% endifnotequal %}{{ snippet.elapsed.hours|floatformat:2 }} hours ago)</p>
{% endfor %}
{% paginator %}
{% else %}
<p><span style="background:yellow">There's no search results{% if CURRENT_LANGUAGE %} for <a href="{% url language_snippets CURRENT_LANGUAGE.key %}" title="{{ CURRENT_LANGUAGE.name }} snippets">{{ CURRENT_LANGUAGE.name }}</a>{% endif %}. Do you want to <a href="{% url snippet_add %}" title="add new snippet">add your snippets</a>?</span></p>
{% endif %}
{% endblock %}